﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using model;
using Bll;

public partial class SR : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["usergroup"].ToString() == "student")
            {
                HyperLink1.Visible = true;
            }
            else
            {
                HyperLink1.Visible = false;
            }
            StudentBll sbll = new StudentBll();
            ResumeBll rbll = new ResumeBll();
            try
            {
                Student student = sbll.GetSingle(Session["userid"].ToString());
                txtsno.Text = student.Sno;
                txtsname.Text = student.Sname;
                txtsmajor.Text = student.Smajor;
                txtssex.Text = student.Ssex;
                DateTime dt = Convert.ToDateTime(student.Sbirth);
                txtsbirth.Text = dt.Year.ToString() + "-" + dt.Month.ToString() + "-" + dt.Day.ToString();
                model.Resume resume = rbll.GetSingle(Session["userid"].ToString());
                txttele.Text = resume.Tele;
                textmobile.Text = resume.Mobile;
                txthuji.Text = resume.Huji;
                txtxueli.Text = resume.Xueli;
                txtyixiang.Text = resume.Yixiang;
                txtrecord.Text = resume.Record;
                txtinter.Text = resume.Inter;
                txtintro.Text = resume.Intro;
                txtaddr.Text = resume.Addr;
            }
            catch (Exception ex)
            {
                string js = "<script>alert('" + ex.Message + "');</script>";
                Response.Write(js);
            }
        }
    }
}